﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.TK
{
    class Class9
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            string sel = ppa.SchemePeriodActing.SchemeActing.GetAuxConfigValue("一次性领取选择权").ToString();
            int bage = ppa.SchemePeriodActing.SchemeActing.Scheme.InsurantAge;

            bool isSel = (sel == "是" && bage <= 50) ? true : false;

            if (ppa.Age <= 60)
            {
                if ((ppa.Period + 1) % 3 == 0)
                {
                    da.Value = ppa.Amount * 0.12;
                }
            }
            if (ppa.Age == 60)
            {
                if (isSel)
                {
                    da.Value = ppa.Amount * 1.8;
                }
                else
                {
                    if ((ppa.Period + 1) % 3 == 0)
                    {
                        da.Value = ppa.Amount * 0.12;
                    }
                }
            }
            else if (ppa.Age > 60)
            {
                if (!isSel)
                {
                    if ((ppa.Period + 1) % 3 == 0)
                    {
                        da.Value = ppa.Amount * 0.12;
                    }
                }
            }

        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("非意外伤害身故"))
            {
                if (ppa.Period == 0)
                {
                    da.Value = ppa.TotalFee;
                }
                else
                {
                    da.Value = ppa.Amount;
                }
                ppa.IsCurrentFinish = true;

            }else if (ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {
                da.Value = ppa.Amount;
                ppa.IsCurrentFinish = true;
            }
            
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            int day = (int)ppa.SchemePeriodActing.SchemeActing.GetAuxConfigValue("住院天数");



        }
    }
}
